package com.dayaokeji.rhythmschoolstudent.client.home.course.task;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuItem;


import com.dayaokeji.rhythmschoolstudent.R;
import com.dayaokeji.rhythmschoolstudent.client.common.base.common.BaseActivity;
import com.dayaokeji.rhythmschoolstudent.utils.ToastUtils;

import butterknife.BindView;

/**
 * 作业
 */
public class CourseTaskActivity extends BaseActivity {

    private static final String EXTRA_COURSE_ID = "course_id";

    @BindView(R.id.toolbar)
    Toolbar toolbar;

    private String courseId;

    public static void navigation(Context context,String courseId) {
        Intent intent = new Intent();
        intent.setClass(context,CourseTaskActivity.class);
        intent.putExtra(EXTRA_COURSE_ID,courseId);
        context.startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_course_task);
        setSupportActionBar(toolbar);
        init();
    }


    private void init() {
        initView();
        initData();
    }

    private void initView() {

    }

    private void initData() {
        courseId = getIntent().getStringExtra(EXTRA_COURSE_ID);
        if (TextUtils.isEmpty(courseId)) {
            ToastUtils.warning("课程ID不能为空");
            return;
        }
        getSupportFragmentManager().beginTransaction().replace(R.id.fl_content, CourseTaskListFragment.newInstance(courseId)).commit();
    }
}
